﻿<%@ Page Language="C#" MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true"
    CodeFile="ViewUserList.aspx.cs" Inherits="Admin_user_ViewUserList" Title="View Users" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="contents">
        <table width="100%" cellpadding="3" cellspacing="0" border="0">
            <tr>
                <td colspan="2">
                    <h1>
                        User List</h1>
                    <asp:Label ID="Label1" runat="server" Visible="false" Width="10px"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="width: 30%" valign="top">
                    Find User Email
                </td>
                <td>
                    <asp:TextBox ID="txtSearchEmail" runat="server" Width="294px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    User Type
                </td>
                <td>
                    <asp:DropDownList ID="ddlUserType" runat="server">
                        <asp:ListItem Value="100">Site Admin
                        </asp:ListItem>
                        <asp:ListItem Value="200">Site User
                        </asp:ListItem>
                        <asp:ListItem Value="300">Provider
                        </asp:ListItem>
                        <asp:ListItem Value="400">Customer
                        </asp:ListItem>
                        <asp:ListItem Value="500">Advertiser
                        </asp:ListItem>
                        <asp:ListItem Value="600">Guest
                        </asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    Select to view
                </td>
                <td>
                    <asp:DropDownList ID="ddlSelecteToView" runat="server">
                        <asp:ListItem Value="100">Login History</asp:ListItem>
                        <asp:ListItem Value="200">Transaction History</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="btnShowResult" runat="server" OnClick="btnShowResult_Click" Text="Submit" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:GridView ID="grvUser" runat="server" AutoGenerateColumns="False" CellSpacing="3"
                        CellPadding="3" Width="100%" DataKeyNames="CEID" DataSourceID="sqlDbUser" CssClass="admin_gridstyle"
                        PagerStyle-CssClass="pgr" GridLines="None" OnRowDataBound="grvUser_RowDataBound" OnSelectedIndexChanged="grvUser_SelectedIndexChanged">
                        <Columns>
                            <asp:BoundField DataField="CEID" HeaderText="CEID" InsertVisible="False" ReadOnly="True"
                                SortExpression="CEID" />
                            <asp:BoundField DataField="Salutation" HeaderText="Salutation" SortExpression="Salutation" />
                            <%--<asp:BoundField DataField="SurName" HeaderText="SurName" SortExpression="SurName" />--%>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblSurName"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <%--<asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />--%>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblEmail"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <%--<asp:BoundField DataField="AuthCode" HeaderText="AuthCode" SortExpression="AuthCode" />--%>
                            <%--<asp:CheckBoxField DataField="IsAcceptTC" HeaderText="IsAcceptTC" SortExpression="IsAcceptTC" />--%>
                            <asp:CheckBoxField DataField="Status" HeaderText="Status" SortExpression="Status" />
                            <asp:BoundField DataField="ModifiedDate" HeaderText="ModifiedDate" SortExpression="ModifiedDate" />
                            <asp:CommandField ShowSelectButton="True" />
                        </Columns>
                        <FooterStyle />
                        <PagerStyle />
                        <SelectedRowStyle />
                        <HeaderStyle CssClass="admin_gridheader" />
                        <EditRowStyle />
                        <AlternatingRowStyle CssClass="admin_gridodd" />
                        <RowStyle CssClass="admin_grideven" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="sqlDbUser" runat="server" ConnectionString="<%$ ConnectionStrings:TH.CX_DBConnectionString %>"
                        SelectCommand="sprocUserSelectItemListByEmail" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="txtSearchEmail" Name="Email" PropertyName="Text"
                                Type="String" />
                            <asp:ControlParameter ControlID="ddlUserType" Name="UsrTypeId" PropertyName="SelectedValue"
                                Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
